﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Configuration;
using System.Data.SqlClient;

/// <summary>
/// Summary description for DistributorCheck
/// </summary>
/// 
namespace Bestlife.ERP.DataAccess
{
    public class DistributorCheck
    {
        SqlDataReader rdR;
        public DistributorCheck()
        {
            //
            // TODO: Add constructor logic here
            //
        }

        public Boolean checkDistributorSt(string Disid)
        {

            Boolean bb = false;
            try
            {
                String connStr = ConfigurationManager.ConnectionStrings["MainConnStr"].ConnectionString;
                Bestlife.ERP.DataAccess.clsCon.connect(connStr);

                String Ssql = "SELECT d.[Dis_ID] FROM [Tbl_Distributor] d where d.Dis_ID='" + Disid + "'";
                //   String Ssqln = "SELECT [Parent_To_User],[Level_id] FROM BestlifeDB.Distributor_Level WHERE User_id='" + Sup_ID + "'";

                rdR = clsCon.ReadTable(Ssql);

                if (rdR.Read())
                {
                    rdR["Dis_ID"].ToString();
                    bb = true;
                }
            }
            catch (Exception)
            {
                // Console.WriteLine(exx);
            }

            finally
            {
                rdR.Close();
            }

            return bb;


        }
    }
}